package org.lagstains
{
	import org.flixel.*;


	public class MenuState extends FlxState
	{
		private var playButton:FlxButton;
		
		[Embed(source = "../../../flixel/org/flixel/data/cursor.png")] private var cursorImg:Class;
				
		public function MenuState()
		{
			FlxG.mouse.show();
			
			var txt:FlxText
				txt = new FlxText(0, (FlxG.height / 2) - 80, FlxG.width, "Lagstains Jam");
				txt.setFormat(null,16,0xFFFFFFFF,"center");
				this.add(txt);
				
				
				// start game button.
				playButton = new FlxButton((FlxG.width / 2)-104/2, 200, onStartClick);
				playButton.loadGraphic((new FlxSprite()).createGraphic(104,15,0xff3a5c39),(new FlxSprite()).createGraphic(104,15,0xff729954));
				var t1:FlxText = new FlxText(15,1,100,"Play");
				t1.color = 0x729954;
				var t2:FlxText = new FlxText(t1.x,t1.y,t1.width,t1.text);
				t2.color = 0xd8eba2;
				playButton.loadText(t1,t2);
				add(playButton);
				
				txt = new FlxText(0, FlxG.height  -24, FlxG.width, "Use arrow keys to move")
				txt.setFormat(null, 8, 0xFFFFFFFF, "center");
				this.add(txt);
				
		}

		override public function update():void
		{
			super.update();
			if(FlxG.keys.X) {
//				FlxG.flash(0xffffffff, 0.75);
				//FlxG.flash.start(0xffffffff, 0.75);
			} else if (FlxG.keys.C) {
				//FlxG.flash.start(0xffff0000, 0.75);
			}
		}
		
		public function onStartClick():void {
			FlxG.state = new GameState();
		}
		
		      
	}
}
